import java.util.Scanner;
public class alg1 {

	
	public static void main(String[] args) {
	
	Scanner leia = new Scanner(System.in);
	double numero[] = new double[15];
	double peso[] = new double [15];
	double media1 = 0, media2 = 0;
	
	numero[0] = 1;
	
	for (int i = 0; i <=14; i++)
	{
		//while (numero[i] > 0)
		{
			System.out.println("Digite o "+(i+1)+" Numero: ");
			numero[i] = leia.nextDouble();
			
			
			if (numero[i] > 0)
			{
				System.out.println("Digite o Peso: ");
				peso[i] = leia.nextDouble();
				media1 = media1 + (numero[i] * peso[i]);
				media2 = media2 + peso[i];
			}
			else
				i =  15;
				
		}
		
	}
	System.out.println("Media Ponderada dos valores: "+media1/media2);
	}

}
